/**
 * 
 */
package sqs.model;

import java.io.Serializable;
import java.util.List;

/**
 * @author kjleng
 *
 */
public abstract class Question implements Serializable{
	private int questionId;
    private String questionText;
	private String mandatory = Question.OPTIONAL;
    private String layout = Question.HORIZONTAL_LAYOUT;
	protected boolean answered=false;
	
	public static final String MANDATORY = "M";
	public static final String OPTIONAL = "O";
	public static final String VERTICAL_LAYOUT = "V";
	public static final String HORIZONTAL_LAYOUT = "H";
	
	public boolean equals(Question q){
		if(q.getQuestionId()==this.getQuestionId()){
			return true;
		}
		return false;
	}
	
	public boolean isCompulsory(){
		if(this.mandatory.equals(Question.MANDATORY)){
			return true;
		}
		return false;
	}
	
	public boolean isAnswered(){
		return answered;
	}
	
	public int getQuestionId() {
		return questionId;
	}
	
        public void setQuestionId(int questionId) {
		this.questionId = questionId;
	}

    public String getQuestionText() {
		return questionText;
	}
        
	public void setQuestionText(String questionText) {
		this.questionText = questionText;
	}
        
	public String getMandatory() {
		return mandatory;
	}
        
	public void setMandatory(String mandatory) {
		this.mandatory = mandatory;
	}
	
        // Added by Joko 18/01/2008
        public String getLayout() {
                return layout;
        }
        
        // Added by Joko 18/01/2008
        public void setLayout(String layout) {
                this.layout = layout;
        }
        
	public abstract void addAnswer(Answer ans);
	public abstract Answer createAnswer();
	public abstract List getOptions();
	public abstract void setOptions(List<Option> options);
        public abstract Option createOption();
	public abstract Scale createScale();
	public abstract int getNumOfRespondents();
	public abstract List<Answer> getAnswers();
        
        // Added by Joko 18/01/2008
        public abstract String getReportOrder();
        public abstract void setReportOrder(String reportOrder);
}
